package cn.jm.study.io;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class c {

	private File directory;

	public List<File> getc() {
		List<File> result = new ArrayList<File>();
		File path = new File("D:\\工作文档\\资料");
		File[] list = path.listFiles();
		for (File item : list) {
			if (getExtName(item.getName()).equals("docx")) {
				result.add(item);
			}
		}
		return result;

	}

	private String getExtName(String name) {
		int post = name.lastIndexOf(".") + 1;
		return name.substring(post, name.length()).toLowerCase();
	}

	public void makeDirectory() {
		String dirName = "d:\\wlf";
		File directoey = new File(dirName);
		if (!directory.exists()) {
			directory.mkdirs();
		}
	}
}